package Controllers;

import Interfaces.IStoreManager_SignUp;
import javax.swing.JOptionPane;

public abstract class StoreManager_SignUp implements IStoreManager_SignUp {

    public void ValidateSignUp(String Name, String LastName, String Email, String Phone, String Username, String Password, String Repass) {
        if (Name.isEmpty() || LastName.isEmpty() || Email.isEmpty() || Phone.isEmpty() || Username.isEmpty() || Password.isEmpty() || Repass.isEmpty()) {
            JOptionPane.showMessageDialog(null, "There Is An Empty Field, Please Try Again");
        } else if (!Email.contains("@") || !Email.contains(".")) {
            JOptionPane.showMessageDialog(null, "Wrong Email");
        } else if (Phone.length() > 10 || Phone.length() < 10) {
            JOptionPane.showMessageDialog(null, "Wrong Phone Number");
        } else if (Phone.matches("[0-9]+") == false) {
            JOptionPane.showMessageDialog(null, "Your Phone Contains a non digit character");
        } else if (!Password.equals(Repass)) {
            JOptionPane.showMessageDialog(null, "Your Password and Repass do not match");
        } else //   put code for SQL connection
        {
            JOptionPane.showMessageDialog(null, "Sign-Up Successful");
        }
    }

}
